<template>
	<view>
		<user-menu :menu ="user_menu" @click-menu="clickMenu"></user-menu>
		<view class="out-login" @tap="outLogin()">退出登录</view>
	</view>
</template>

<script>
	import userMenu from '../../components/unit/menu.vue';
	export default{
		components:{userMenu},
		data(){
			return {
				user_menu : [
					{name : '注册协议' , icon:"&#xe601;",src :require('static/image/userindex/zc02.png')},
					{name : '购物协议' , icon:"&#xe628;",src :require('static/image/userindex/gw02.png')}
				],
			}
		},
		methods:{
			//退出登录
			outLogin(){
				uni.showModal({
				    title: '提示',
				    content: '确定退出登录？',
				    success:  (res) => {
				        if (res.confirm) {
							this.ajax('login/outLogin',{
								success:(res) => {}
							})
				            uni.reLaunch({
				            	url:'/pages/login/login'
				            })
				        } 
				    }
				});
			},
			clickMenu(e){
				var url = '';
				if(e == 0){
					url ='/pages/user/reg-dom';
				}
				if(e == 1){
					url ='/pages/user/buy-dom';
				}
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style lang="scss">

	.out-login{position: fixed;bottom: 0;width: 100%;height:110upx;line-height: 110upx;text-align: center;left: 0;color:#fff;background: #000;}
</style>
